package springcloud.easybuy.controller;


import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import springcloud.easybuy.api.NewsManagerClient;
import springcloud.easybuy.entity.EasybuyNews;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class newsController {
    @Resource
    private NewsManagerClient newsManagerClient;

    @RequestMapping("/queryAll")
    public String  queryAll(ModelMap map){
        List<EasybuyNews> list=newsManagerClient.queryAll();
        map.addAttribute("newsList",list);
        return "/newsList";
    }
}
